#pragma once

#include <QWidget>

class TimeChooseWidget;
class QAbstractButton;
class QCalendarWidget;
class QDateTimeEdit;
class PlaybackCtrlFrame : public QWidget
{
	Q_OBJECT

public:
	PlaybackCtrlFrame(QWidget *parent=nullptr);
	~PlaybackCtrlFrame();
private:
	void initialize();

private:
	bool isPlaying;
signals:
	void play(const QDateTime& begin, const QDateTime& end);
	void pause();
	void stop();
	void slow();
	void fast();
	void resume();
	void clear();
	void download(const QDateTime& begin, const QDateTime& end,bool isBegin);
public slots:
	void handleControlAction(int id);

public:
	QCalendarWidget* calendar;
	QDateTimeEdit* startTimeSelecter;
	QDateTimeEdit* endTimeSelecter;

	QDateTimeEdit* downloadStartTimeSelecter;
	QDateTimeEdit* downloadEndTimeSelecter;

	QAbstractButton* slowerBtn;
	QAbstractButton* playBtn;
	QAbstractButton* fasterBtn;
	QAbstractButton* stopBtn;
	QAbstractButton* clearBtn;
	QAbstractButton* startDownloadBtn;
	QAbstractButton* stopDownloadBtn;
};
